header main {
    position: absolute;
}

main footer {
    overflow: auto;
}

.square {
    width: 100px;
    height: 100px;
    background: red;
}

.header {
    z-index: 2;
}